
<style scoped>


div{
    width: 100%;
    height: 48px;
     position: absolute;
     bottom: 0
       
     }

      input{
         width: 60%;
         height: 30px;
         margin-left: 40px;
      }
      button{
          border: none;
          background-color: whitesmoke;
          margin-left: 10px;

      }
    
</style>


<template > <!-- vue实例外创建 -->
    <div>
          <input type="text"  v-model="compentes">
          <RouterLink to="/commonts">
             <button @click="mousgte">发送</button>
          </RouterLink>
         
    </div>
</template>

<script setup lang="ts">
   
  import { ref } from 'vue'
   const compentes = ref('')
       const  comment = ref(JSON.parse(localStorage.getItem('comment')) || [])
     const mousgte=()=>{
if (compentes.value == '') {
          return;
     }
     else {
          console.log(comment.value)
          comment.value.unshift(compentes.value)
          localStorage.setItem('comment', JSON.stringify(comment.value))
          compentes.value = ''
     }
     }

     const mutset=()=>{
               
     }


</script>